/*
 * DocShell.java   (28.jul.07)
 *
 * @author      Lobsang Alvites Szaler
 * @version     1.00
 *
 * Copyright (c) Soluciones Info Móviles SAC
 *
 */

package sim.shell;

import sim.utils.*;
import sim.utils.tree.*;
import sim.framework.*;


public class DocShell extends Document {
    
    protected TreeShell   m_TS;
    
    /*
     *  Constructor
     */
    public DocShell( final Simlet s ) {
        super(s);
        m_TS = new TreeShell( s );
    }
    
    public boolean load() {
        // Creates a new Shell Tree structure
        setTroot( m_TS.create( null, null, 0 ) );
        // Loads the Shell Tree data and returns if succeeded or failed
        return m_TS.load( FileNames.FILE_SHEL );
    }
    
    public boolean save() {
        return false;
    }
    
    // ----------------------------------------------------------------
    // Methods to get and set Shell's Tree, Root, Select and Command
    // ----------------------------------------------------------------
    public void setTreeShell( final TreeShell t ) {
        m_TS = t;
    }
    
    public TreeShell getTreeShell() {
        return m_TS;
    }
    
    public void setTroot( final Tree_s s ) {
        m_TS.m_root = s;
    }
    
    public Tree_s getTroot() {
        return m_TS.m_root;
    }
    
    public void setTsel( final Tree_s s ) {
        m_TS.m_sel = s;
    }
    
    public Tree_s getTsel() {
        return m_TS.m_sel;
    }
    
    public void setTcmd( final Tree_s s ) {
        m_TS.m_cmd = s;
    }
    
    public Tree_s getTcmd() {
        return m_TS.m_cmd;
    }
    
}
